package com.gaohe;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.nio.file.Paths;

public class Demo {
    public static void main(String[] args) {
        FastAutoGenerator.create(
                        "jdbc:mysql:///jiayunplus",
                        "root",
                        "1234")
                .globalConfig(builder -> builder
                        .author("xiaoshuai")
                        .outputDir("D://code")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("com.gaohe")
                        .entity("pojo")
                        .mapper("mapper")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .entityBuilder()
                        .enableLombok()
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
